package 字符串;

import java.util.Scanner;

public class 模拟用户登录_简单 {
	
	public static void main(String[] args) {
		String userName = "sgx";
		String userPassword = "123";
		
		Scanner sc = new Scanner(System.in);

		
		for (int i = 1; i <= 3; i++) {
			
			System.out.print("请输入账号：");
			String inputName = sc.next();
			System.out.print("请输入密码：");
			String inputPassword = sc.next();
			
			if (userName.equals(inputName) && userPassword.equals(inputPassword)) {
				System.out.println("登陆成功");
				
			}else {
				if (i==3) {
					System.out.println("小伙子盗号的吧？");
				}else {
					System.out.println("登陆失败，还剩"+(3-i)+"次");
					System.out.println("--------------");
				}
				
			}
		}
		
		
	}

}
